<template>
	<div>
		<!-- 头部 -->
		<div class="header">
			<van-nav-bar
				title="商品分类"
				left-text="返回"
				left-arrow
				@click-left="onClickLeft"
			/>
		</div>
		<!-- 头部结束 -->
		<div class="classBoss">
			<van-sidebar v-model="active">
				<van-sidebar-item
					v-for="(item, index) in classList"
					:key="index"
					:title="item"
				/>
			</van-sidebar>
		</div>
	</div>
</template>
<script setup>
import { ref } from "vue"

import { getClassList } from "../services/index"

// 返回上一级
const onClickLeft = () => history.back()
// 初始化首次显示
const active = ref(0)

// 获取产品的分类列表
const classList = ref([])

const getClass = async () => {
	const result = await getClassList()
	classList.value = result.data.data
}
getClass()

// 产品分类下品牌列表

</script>
<style scoped>
.classBoss {
	display: flex;
}
.classDetail {
	flex: 1;
}
</style>
